package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	// 打开文件
	file, e := os.Open("doc/hello.txt")
	if e != nil {
		fmt.Println("error happened.", e)
		return
	}
	defer file.Close()

	reader := bufio.NewReader(file)
	for ; ; {
		line, _, e := reader.ReadLine()
		if e == io.EOF {
			break
		}
		fmt.Printf("content is %s\n", line)

	}
}
